/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vk.message.gui.activities;

import android.app.TabActivity;
import android.view.View;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import vk.message.R;
import vk.message.gui.activities.Search;
import vk.message.gui.activities.Contacts;
import vk.message.gui.activities.Settings_vk;
import vk.message.gui.activities.Messages;
import vk.message.gui.component.TabButtonFactory;


/**
 *
 * @author 4ui
 */
public class ContainerAct extends TabActivity {
    /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.bottomtab);

       TabHost tabHost = getTabHost();
       TabHost.TabSpec tabSpec;
       Intent intent;
       
       View view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_messages, "Cообщения");
       intent = new Intent().setClass(this, Messages.class);
       tabSpec = tabHost.newTabSpec("messages").setIndicator(view).setContent(intent);
       tabHost.addTab(tabSpec);

       view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_contacts, "Контакты");
       intent = new Intent().setClass(this, Contacts.class);
       tabSpec = tabHost.newTabSpec("contacts").setIndicator(view).setContent(intent);
       tabHost.addTab(tabSpec);

       view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_search, "Поиск");
       intent = new Intent().setClass(this, Search.class);
       tabSpec = tabHost.newTabSpec("search").setIndicator(view).setContent(intent);
       tabHost.addTab(tabSpec);

       view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_settings, "Настройки");
       intent = new Intent().setClass(this, Settings_vk.class);
       tabSpec = tabHost.newTabSpec("settings").setIndicator(view).setContent(intent);
       tabHost.addTab(tabSpec);
       
       tabHost.setCurrentTab(0);
   }
}